<template>
    <div class="home">
        <h2>home页</h2>
    </div>
</template>

<script setup lang="ts" name="home">
    import { onMounted } from 'vue';
    import { useRouter } from 'vue-router';

    const router = useRouter();
    onMounted(() => {// 编程式路由跳转
        // 初始化逻辑可以放在这里
        console.log('Home component mounted');
        setTimeout(() => {
            router.push('/news');
        }, 1000);
    });
</script>

<style lang="css" scoped>
.home {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}
</style>